@import 'variables';
@import 'colors';
@import 'shadow';

.outline-drawer {
  position: relative;
  z-index: -1;
  top: 0;
  left: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  visibility: hidden;
  overflow: hidden;

  &__modal {
    .shadow_light_regular();
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    position: absolute;
    z-index: 21;
    height: 100%;
    background-color: @white;
    transition-duration: 0.4s;
    overflow: hidden;
  }

  &__header,
  &__main,
  &__footer {
    width: 100%;
    box-sizing: border-box;
  }

  &__header,
  &__footer {
    flex-shrink: 0;
  }

  &__title,
  &__main,
  &__footer {
    padding: 0 16px;
  }

  &__header,
  &__title {
    position: relative;
    z-index: 1;
    margin: 0 auto;
    height: 52px;
    line-height: 52px;
    overflow: hidden;
  }

  &__title {
    font-size: 16px;
    font-weight: 400;
    margin: 0 16px;
    box-sizing: border-box;
    border-bottom: 1px solid @primary_border_color;
  }

  &__close {
    position: absolute;
    z-index: 2;
    top: 50%;
    right: 12px;
    width: 20px;
    height: 20px;
    line-height: 20px;
    color: @fourth_text_color;
    font-size: 20px;
    text-align: center;
    cursor: pointer;
    transform: translateY(-50%);
    overflow: hidden;

    .outline-icon {
      position: absolute;
      z-index: 2;
      top: 0;
      left: 0;
    }

    &:hover {
      color: @third_text_color;
    }
  }

  &__main {
    flex: 1;
    overflow: auto;

    &.overflow-hidden {
      overflow: hidden;
    }
  }

  &__footer {
    margin: 0 auto;
    text-align: right;
    overflow: hidden;
  }

  &__overlay {
    content: '';
    position: relative;
    z-index: 1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: @white;
    opacity: 0.1;
    overflow: hidden;
  }

  &_rtl,
  &_ltr {
    &.outline-drawer {
      &_tiny {
        width: 280px;
      }

      &_mini {
        width: 480px;
      }

      &_small {
        width: 540px;
      }

      &_regular {
        width: 680px;
      }

      &_medium {
        width: 720px;
      }

      &_large {
        width: 960px;
      }
    }
  }

  &_rtl {
    border-left: 1px solid @primary_border_color;

    &.outline-drawer {
      &_tiny {
        &.outline-drawer_closed {
          right: -290px;
        }
      }

      &_mini {
        &.outline-drawer_closed {
          right: -490px;
        }
      }

      &_small {
        &.outline-drawer_closed {
          right: -550px;
        }
      }

      &_regular {
        &.outline-drawer_closed {
          right: -690px;
        }
      }

      &_medium {
        &.outline-drawer_closed {
          right: -730px;
        }
      }

      &_large {
        &.outline-drawer_closed {
          right: -970px;
        }
      }
    }
  }

  &_ltr {
    border-right: 1px solid @primary_border_color;

    &.outline-drawer {
      &_tiny {
        &.outline-drawer_closed {
          left: -290px;
        }
      }

      &_mini {
        &.outline-drawer_closed {
          left: -490px;
        }
      }

      &_small {
        &.outline-drawer_closed {
          left: -550px;
        }
      }

      &_regular {
        &.outline-drawer_closed {
          left: -690px;
        }
      }

      &_medium {
        &.outline-drawer_closed {
          left: -730px;
        }
      }

      &_large {
        &.outline-drawer_closed {
          left: -970px;
        }
      }
    }
  }

  &_ttb,
  &_btt {
    left: 0;
    width: 100%;

    &.outline-drawer {
      &_tiny {
        height: 240px;
      }

      &_mini {
        height: 320px;
      }

      &_small {
        height: 360px;
      }

      &_regular {
        height: 400px;
      }

      &_medium {
        height: 440px;
      }

      &_large {
        height: 480px;
      }
    }
  }

  &_ttb {
    border-bottom: 1px solid @primary_border_color;

    &.outline-drawer {
      &_tiny {
        &.outline-drawer_closed {
          top: -250px;
        }
      }

      &_mini {
        &.outline-drawer_closed {
          top: -330px;
        }
      }

      &_small {
        &.outline-drawer_closed {
          top: -370px;
        }
      }

      &_regular {
        &.outline-drawer_closed {
          top: -410px;
        }
      }

      &_medium {
        &.outline-drawer_closed {
          top: -450px;
        }
      }

      &_large {
        &.outline-drawer_closed {
          top: -490px;
        }
      }
    }
  }

  &_btt {
    top: initial;
    border-top: 1px solid @primary_border_color;

    &.outline-drawer {
      &_tiny {
        &.outline-drawer_closed {
          bottom: -250px;
        }
      }

      &_mini {
        &.outline-drawer_closed {
          bottom: -330px;
        }
      }

      &_small {
        &.outline-drawer_closed {
          bottom: -370px;
        }
      }

      &_regular {
        &.outline-drawer_closed {
          bottom: -410px;
        }
      }

      &_medium {
        &.outline-drawer_closed {
          bottom: -450px;
        }
      }

      &_large {
        &.outline-drawer_closed {
          bottom: -490px;
        }
      }
    }
  }

  &_opened {
    visibility: visible;
    z-index: var(--outline-zIndex);

    &.outline-drawer {
      position: fixed;

      &_rtl {
        right: 0;
      }

      &_ltr {
        left: 0;
      }

      &_ttb {
        top: 0;
      }

      &_btt {
        bottom: 0;
      }
    }
  }

  &_offset {
    &.outline-drawer {
      &_rtl,
      &_ltr {
        height: calc(100% - 4em);
        top: 50%;
        transform: translateY(-50%);
      }

      &_ttb,
      &_btt {
        width: calc(100% - 4em);
        left: 50%;
        transform: translateX(-50%);
      }

      &_opened {
        &.outline-drawer {
          &_rtl {
            right: 2em;
          }

          &_ltr {
            left: 2em;
          }

          &_ttb {
            top: 2em;
          }

          &_btt {
            bottom: 2em;
          }
        }
      }
    }
  }

  &_auto {
    &.outline-drawer {
      &_rtl,
      &_ltr {
        height: auto;
        max-height: calc(100% - 4em);
      }
    }
  }

  &_full {
    padding: 0;
  }
}
